/**
 * 
 */
package ccrClasses.layer2;

import ccrClasses.ICcr;

/**
 * The identifier of the individual associated with the CCR.
 * @author matheus
 *
 */
public class Actor implements ICcr{
	
	public static String OPEN_TAG = "<Actor>";

	public static String CLOSE_TAG = "</Actor>";
	
	private ActorID actorID;
	
	private ActorRole actorRole;

	public Actor(ActorID actorID, ActorRole actorRole) {
		super();
		this.actorID = actorID;
		this.actorRole = actorRole;
	}
	
	public Actor(ActorID actorID) {
		super();
		this.actorID = actorID;		
	}

	public Actor() {
		super();
	}

	/**
	 * @return the actorID
	 */
	public ActorID getActorID() {
		return actorID;
	}

	/**
	 * @param actorID the actorID to set
	 */
	public void setActorID(ActorID actorID) {
		this.actorID = actorID;
	}

	/**
	 * @return the actorRole
	 */
	public ActorRole getActorRole() {
		return actorRole;
	}

	/**
	 * @param actorRole the actorRole to set
	 */
	public void setActorRole(ActorRole actorRole) {
		this.actorRole = actorRole;
	}

	/**
	 * @return the oPEN_TAG
	 */
	public String getOPEN_TAG() {
		return OPEN_TAG;
	}

	/**
	 * @return the cLOSE_TAG
	 */
	public String getCLOSE_TAG() {
		return CLOSE_TAG;
	}

	@Override
	public String constructCcrString() {
		String ccrActor = OPEN_TAG;
		
		if(actorID != null){
			ccrActor = ccrActor + actorID.constructCcrString();
		}
		
		if(actorRole != null){
			ccrActor = ccrActor + actorRole.constructCcrString();
		}
		
		ccrActor = ccrActor + CLOSE_TAG;
		
		return ccrActor;
	}
	
	
}
